@inject NavigationManager navigationManager;
@if (!Example.New && !Example.Updated && !Example.Pro)
{
    <RadzenPanelMenuItem @bind-Expanded=@Example.Expanded Text="@Example.Name" Path="@GetUrl()" Icon="@Example.Icon" aria-label="@Example.Name" ChildContent=@ChildContent />
}
else
{
    <RadzenPanelMenuItem @bind-Expanded=@Example.Expanded Text="@Example.Name" Path="@GetUrl()" Icon="@Example.Icon" aria-label="@Example.Name" ChildContent="@ChildContent">
        <Template>
            @Example.Name
            <RadzenBadge Text="Updated" Visible=@Example.Updated BadgeStyle="BadgeStyle.Info"/>
            <RadzenBadge Text="New" Visible=@Example.New BadgeStyle="BadgeStyle.Success"/>
            <RadzenBadge Text="Pro" Visible=@Example.Pro BadgeStyle="BadgeStyle.Danger"/>
        </Template>
    </RadzenPanelMenuItem>
}
@code {
    [Parameter]
    public Example Example { get; set; }

    [Parameter]
    public RenderFragment ChildContent { get; set; }

    string GetUrl()
    {
        return Example.Path == null ? Example.Path : $"{Example.Path}{new Uri(navigationManager.Uri).Query}";
    }
}